GBML manual / Backgrounds

perspective_floor_screen_y

The screen y, counted down from the screen’s top-left pixel, where the point the last perspective_floor_project call found touches the floor.

Game Boy: not available

Game Boy Color: not available

Sega Genesis: not built yet - The Sega Genesis will draw the road its own way.

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

perspective_floor_screen_y() -> real

Returns

real

Description

The screen y, counted down from the screen's top-left pixel, where the point the last perspective_floor_project call found touches the floor. It is where the thing's feet are: draw a picture whose origin is at its bottom, or move it up by half its height times the scale, so it stands on the road. It is 0 before any call, and after a call that said false.

Example

if (perspective_floor_project(300, 640)) {
    var feet = perspective_floor_screen_y();
}

feet is the screen row where the point meets the road.

On the GBA

It is where the thing’s feet are: draw a sprite whose origin is at its bottom so it stands on the road. 0 before any call, and after a call that said false.

See also: Perspective floorperspective_floor_projectperspective_floor_screen_xperspective_floor_scale